package com.glp.work.flow.constant;

import lombok.Getter;
import org.apache.commons.lang3.StringUtils;

/**
 * @author : 郭永伟
 * @date : 2020/11/25/17:01
 * @description :
 */
@Getter
public enum TaskDistributionEnum {
    ROLES("0", "角色"),
    USER("1", "用户"),
    DYNAMIC("2", "动态分配");
    private String code;
    private String remark;

    TaskDistributionEnum(String code, String remark) {
        this.code = code;
        this.remark = remark;
    }

    public static TaskDistributionEnum getEnum(String code) {
        if (StringUtils.isNotBlank(code)) {
            for (TaskDistributionEnum os : values()) {
                if (code.equals(os.getCode())) {
                    return os;
                }
            }
        }
        return null;
    }
}
